﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace _03_ThreadPool
{
    class Program
    {
        static void Thread1(object obj)
        {
            for (int i = 0; i < 5; i++)
            {
                Thread.Sleep(500);
                Console.WriteLine("{0}; Thread works, id: {1}", i, Thread.CurrentThread.ManagedThreadId);
            }
        }
        static void Main(string[] args)
        {
            for (int i = 0; i < 3; i++)
            {
                ThreadPool.QueueUserWorkItem(Thread1);
            }

            Console.ReadLine();
        }
    }
}
